package com.ocean.web.controller.index;

import com.ocean.common.core.domain.AjaxResult;
import com.ocean.inxex.service.NoticeService;
import com.ocean.inxex.vo.oNotice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
/**
 *平台公告
 */
@Controller
@RequestMapping("/home")
public class NoticeController {

    @Autowired
    private NoticeService noticeService;

    private String prefix = "index";

    @GetMapping("/notice")
    public String notice()
    {
        return prefix + "/notice/notice";
    }
    @GetMapping("/noticeid")
    public String noticeid()
    {
        return prefix + "/notice/noticeid";
    }
    /**
     * id查询详情
     * @param vo
     * @return
     */
    @PostMapping("/getbyid")
    @ResponseBody
    public AjaxResult getbyid(oNotice vo)
    {
        oNotice notice = noticeService.getbyid(vo.getId());
        return AjaxResult.success(notice);
    }
}
